package com.sensePlusVR.utils;

import android.view.View;

public class ViewUtils {

	// 触摸(x,y)是否在view的区域内
	public static boolean isTouchPointInView(View view, int x, int y) {
		if (view == null) {
			return false;
		}
		int[] location = new int[2];
		view.getLocationOnScreen(location);
		int left = location[0];
		int top = location[1];
		int right = left + view.getMeasuredWidth();
		int bottom = top + view.getMeasuredHeight();
		if (y >= top && y <= bottom && x >= left && x <= right) {
			return true;
		}
		return false;
	}

}
